<?php
/* 	These code was generated using phpCIGen v 0.1.b (24/06/2009)
	#zaqi 		zaqi.smart@gmail.com,http://zenzaqi.blogspot.com, 
	#CV. Trust Solution, jl. Saronojiwo 19 Surabaya, http://www.ts.co.id
	
	+ Module  		: m_setup View
	+ Description	: For record view
	+ Filename 		: v_m_setup.php
 	+ creator  		: 
 	+ Created on 22/Jan/2012 19:08:53
	
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<style type="text/css">
        p { width:650px; }
		.search-item {
			font:normal 11px tahoma, arial, helvetica, sans-serif;
			padding:3px 10px 3px 10px;
			border:1px solid #fff;
			border-bottom:1px solid #eeeeee;
			white-space:normal;
			color:#555;
		}
		.search-item h3 {
			display:block;
			font:inherit;
			font-weight:bold;
			color:#222;
		}
		
		.search-item h3 span {
			float: right;
			font-weight:normal;
			margin:0 0 5px 5px;
			width:100px;
			display:block;
			clear:none;
		}
    </style>
<script>
/* declare function */		
var m_setup_DataStore;
var m_setup_ColumnModel;
var m_setupListEditorGrid;
var m_setup_saveForm;
var m_setup_saveWindow;
var m_setup_searchForm;
var m_setup_searchWindow;
var m_setup_SelectedRow;
var m_setup_ContextMenu;

//declare konstant
var post2db = '';
var msg = '';
var pageS=15;

/* declare variable here for Field*/
var setup_idField;
var setup_ppnField;
var setup_kdvoField;
var setup_kcb5Field;
var setup_kcb6Field;
var setup_kcb7Field;
var setup_procmarsitekField;
var setup_procmmeField;
var setup_procmstrukturField;
var setup_kdvoJabatanField;
var setup_kcb5JabatanField;
var setup_kcb6JabatanField;
var setup_kcb7JabatanField;
var setup_procmarsitekJabatanField;
var setup_procmmeJabatanField;
var setup_procmstrukturJabatanField;
var setup_idSearchField;
var setup_ppnSearchField;

/* on ready fuction */
Ext.onReady(function(){
  	Ext.QuickTips.init();
	function m_setup_save(){
		if(is_m_setup_form_valid() && setup_ppnField.getValue() <= 100){
			m_setup_saveForm.getForm().submit({
				method: 'POST',
				waitTitle:'Please wait.....',
				waitMsg:'Proses Penyimpanan...',
				url: 'index.php?c=c_m_setup&m=m_setup_update',
				success: function(opt, success, response){
					Ext.MessageBox.alert(post2db+' OK','Data Sukses disimpan');
				},
				failure: function(response){
					var result=response.responseText;
					Ext.MessageBox.show({
						   title: 'Error',
						   msg: 'Koneksi database server gagal, hubungi Administrator',
						   buttons: Ext.MessageBox.OK,
						   animEl: 'database',
						   icon: Ext.MessageBox.ERROR
					});	
				}
			});
			
		} else {
			Ext.MessageBox.show({
				title: 'Warning',
				msg: 'Data input belum sempurna',
				buttons: Ext.MessageBox.OK,
				animEl: 'save',
				icon: Ext.MessageBox.WARNING
			});
		}
	}
 	/* End of Function */
  /* Function for Retrieve DataStore */
	/* End of Function */
	
  		
	/* Function for Check if the form is valid */
	function is_m_setup_form_valid(){
		return (setup_ppnField.isValid());
	}
  	/* End of Function */
  
  	/* Function for Displaying  create Window Form */
	function display_form_window(){
		if(!m_setup_saveWindow.isVisible()){
			m_setup_reset_form();
			post2db='CREATE';
			msg='created';
			m_setup_saveWindow.show();
		} else {
			m_setup_saveWindow.toFront();
		}
	}
  	/* End of Function */
   
	/* Function for Retrieve DataStore */
	m_setup_DataStore = new Ext.data.Store({
		id: 'm_setup_DataStore',
		proxy: new Ext.data.HttpProxy({
			url: 'index.php?c=c_m_setup&m=get_action', 
			method: 'POST'
		}),
		baseParams:{task: "LIST"}, // parameter yang di $_POST ke Controller
		reader: new Ext.data.JsonReader({
			root: 'results',
			totalProperty: 'total'
		},[
			{name: 'setup_ppn', type: 'int', mapping: 'PPN11'},
			{name: 'setup_kdvo', type: 'string', mapping: 'KDVO01'},
			{name: 'setup_kdvojabatan', type: 'string', mapping: 'KDVO02'},
			{name: 'setup_procmarsitek', type: 'string', mapping: 'PURCM_ARSITEK01'},
			{name: 'setup_procmarsitekjabatan', type: 'string', mapping: 'PURCM_ARSITEK02'},
			{name: 'setup_procmme', type: 'string', mapping: 'PURCM_ME01'},
			{name: 'setup_procmmejabatan', type: 'string', mapping: 'PURCM_ME02'},
			{name: 'setup_procmstruktur', type: 'string', mapping: 'PURCM_STRUKTUR01'},
			{name: 'setup_procmstrukturjabatan', type: 'string', mapping: 'PURCM_STRUKTUR02'},
			{name: 'setup_procm', type: 'string', mapping: 'PROCM01'},
			{name: 'setup_procmjabatan', type: 'string', mapping: 'PROCM02'},
			{name: 'setup_ambang', type: 'float', mapping: 'AMBANG11'}
		])
	});
	/* End of Function */
	/* Identify  setup_ppn Field */
	var setup_pasalJenisKontrak = new Ext.form.ComboBox({
		id : 'setup_pasalJenisKontrak',
		store : ['SPJB','SPB','IPB'],
		fieldLabel : 'Jenis Kontrak',
		name : 'setup_pasaljeniskontrak',
		forceSelection: true,
		triggerAction: 'all',
	});
	var setup_pasalContentType = new Ext.form.ComboBox({
		id : 'setup_pasalContentType',
		store : ['Header','Footer'],
		fieldLabel : 'Type Konten',
		name : 'setup_pasaltypekonten',
		forceSelection: true,
		triggerAction: 'all',
	});
	var setup_pasalNilaiKontrak = new Ext.form.ComboBox({
		id : 'setup_pasalNilaiKontrak',
		store : ['Lebih Dari Ambang','Kurang Dari Ambang'],
		fieldLabel : 'Nilai Kontrak',
		name : 'setup_pasalnilaikontrak',
		hidden : true,
		forceSelection: true,
		triggerAction: 'all',
	});
	var setup_editContentField = new Ext.ux.TinyMCE({
		fieldLabel: 'Konten',
		hideLabel: false,
		name : 'setup_pasalkonten',
		tinymceSettings: {
			mode : "textareas",
			theme : "advanced",
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,insertdate,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "none",
			theme_advanced_resizing : false,
			theme_advanced_source_editor_height : 300
		},
		width: "98%",
		height: "350",
		value: ""
	});
	/* cetak spk */
	var setup_cetakSPKNilaiKontrak = new Ext.form.ComboBox({
		id : 'setup_cetakSPKNilaiKontrak',
		store : ['Lebih Dari Ambang','Kurang Dari Ambang'],
		fieldLabel : 'Nilai Kontrak',
		name : 'setup_cetakspknilaikontrak',
		forceSelection: true,
		hidden : true,
		triggerAction: 'all',
	});
	
	var setup_cetakSPKContentType = new Ext.form.ComboBox({
		id : 'setup_cetakSPKContentType',
		store : ['Konten','Footer'],
		fieldLabel : 'Type Konten',
		name : 'setup_cetakspkcontenttype',
		forceSelection: true,
		triggerAction: 'all',
	});
	
	var setup_cetakSPKField = new Ext.ux.TinyMCE({
		fieldLabel: 'Konten',
		hideLabel: false,
		name : 'setup_cetakspk',
		tinymceSettings: {
			mode : "textareas",
			theme : "advanced",
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,insertdate,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "none",
			theme_advanced_resizing : false,
			theme_advanced_source_editor_height : 300
		},
		width: "98%",
		height: "350",
		value: ""
	});
	
	/* cetak ipb */
	
	var setup_cetakIPBNilaiKontrak = new Ext.form.ComboBox({
		id : 'setup_cetakIPBNilaiKontrak',
		store : ['Lebih Dari Ambang','Kurang Dari Ambang'],
		fieldLabel : 'Nilai Kontrak',
		name : 'setup_cetakIPBnilaikontrak',
		forceSelection: true,
		hidden : true,
		triggerAction: 'all',
	});
	
	var setup_cetakIPBContentType = new Ext.form.ComboBox({
		id : 'setup_cetakIPBContentType',
		store : ['Konten','Footer'],
		fieldLabel : 'Type Konten',
		name : 'setup_cetakIPBcontenttype',
		forceSelection: true,
		triggerAction: 'all',
	});
	
	var setup_cetakIPBField = new Ext.ux.TinyMCE({
		fieldLabel: 'Konten',
		hideLabel: false,
		name : 'setup_cetakIPB',
		tinymceSettings: {
			mode : "textareas",
			theme : "advanced",
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,insertdate,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "none",
			theme_advanced_resizing : false,
			theme_advanced_source_editor_height : 300
		},
		width: "98%",
		height: "350",
		value: ""
	});
	
		/* cetak PO */
	var setup_cetakPONilaiKontrak = new Ext.form.ComboBox({
		id : 'setup_cetakPONilaiKontrak',
		store : ['Lebih Dari Ambang','Kurang Dari Ambang'],
		fieldLabel : 'Nilai Kontrak',
		name : 'setup_cetakPOnilaikontrak',
		forceSelection: true,
		hidden : true,
		triggerAction: 'all',
	});
	
	var setup_cetakPOContentType = new Ext.form.ComboBox({
		id : 'setup_cetakPOContentType',
		store : ['Konten','Footer'],
		fieldLabel : 'Type Konten',
		name : 'setup_cetakPOcontenttype',
		forceSelection: true,
		triggerAction: 'all',
	});
	
	var setup_cetakPOField = new Ext.ux.TinyMCE({
		fieldLabel: 'Konten',
		hideLabel: false,
		name : 'setup_cetakPO',
		tinymceSettings: {
			mode : "textareas",
			theme : "advanced",
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,code,|,insertdate,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "none",
			theme_advanced_resizing : false,
			theme_advanced_source_editor_height : 300
		},
		width: "98%",
		height: "350",
		value: ""
	});
	
	
	function getKontenSPK(){
		var type_konten = setup_cetakSPKContentType.getValue();
		var nilai_kontrak = setup_cetakSPKNilaiKontrak.getValue();
		if ( type_konten != ''  && (type_konten == 'Konten' || nilai_kontrak != '') ){
		Ext.Ajax.request({
			waitMsg : 'Sedang mengambil data',
			url : 'index.php?c=c_m_setup&m=get_kontenkontrak',
			params : {
				jenis_kontrak : 'SPK',
				type_konten : type_konten,
				nilai_kontrak	: nilai_kontrak
			}, success : function(response){
				setup_cetakSPKField.setValue(response.responseText);
			}
		});
		}
	}
	
	function getKontenIPB(){
		var type_konten = setup_cetakIPBContentType.getValue();
		var nilai_kontrak = setup_cetakIPBNilaiKontrak.getValue();
		if ( type_konten != ''  && (type_konten == 'Konten' || nilai_kontrak != '') ){
		Ext.Ajax.request({
			waitMsg : 'Sedang mengambil data',
			url : 'index.php?c=c_m_setup&m=get_kontenkontrak',
			params : {
				jenis_kontrak : 'IPB',
				type_konten : type_konten,
				nilai_kontrak	: nilai_kontrak
			}, success : function(response){
				setup_cetakIPBField.setValue(response.responseText);
			}
		});
		}
	}
	
	function getKontenPO(){
		var type_konten = setup_cetakPOContentType.getValue();
		var nilai_kontrak = setup_cetakPONilaiKontrak.getValue();
		if ( type_konten != ''  && (type_konten == 'Konten' || nilai_kontrak != '') ){
		Ext.Ajax.request({
			waitMsg : 'Sedang mengambil data',
			url : 'index.php?c=c_m_setup&m=get_kontenkontrak',
			params : {
				jenis_kontrak : 'PO',
				type_konten : type_konten,
				nilai_kontrak	: nilai_kontrak
			}, success : function(response){
				setup_cetakPOField.setValue(response.responseText);
			}
		});
		}
	}
	
	function getKonten(){
		var jenis_kontrak = setup_pasalJenisKontrak.getValue();
		var type_konten = setup_pasalContentType.getValue();
		var nilai_kontrak = setup_pasalNilaiKontrak.getValue();
		if (jenis_kontrak != '' && type_konten != ''  && (type_konten == 'Header' || nilai_kontrak != '') ){
		Ext.Ajax.request({
			waitMsg : 'Sedang mengambil data',
			url : 'index.php?c=c_m_setup&m=get_kontenkontrak',
			params : {
				jenis_kontrak : jenis_kontrak,
				type_konten : type_konten,
				nilai_kontrak	: nilai_kontrak
			}, success : function(response){
				setup_editContentField.setValue(response.responseText);
			}
		});
		}
	}
	
	
	setup_cetakSPKContentType.on('select',function(){
		var type_konten = setup_cetakSPKContentType.getValue();
		if (type_konten == 'Konten'){
			setup_cetakSPKNilaiKontrak.hide();
		}else{
			setup_cetakSPKNilaiKontrak.show();
		}
		getKontenSPK();
	});
	setup_cetakSPKNilaiKontrak.on('select',getKontenSPK);
	
	setup_cetakPOContentType.on('select',function(){
		var type_konten = setup_cetakPOContentType.getValue();
		if (type_konten == 'Konten'){
			setup_cetakPONilaiKontrak.hide();
		}else{
			setup_cetakPONilaiKontrak.show();
		}
		getKontenPO();
	});
	setup_cetakPONilaiKontrak.on('select',getKontenPO);
	
	
	setup_cetakIPBContentType.on('select',function(){
		var type_konten = setup_cetakIPBContentType.getValue();
		if (type_konten == 'Konten'){
			setup_cetakIPBNilaiKontrak.hide();
		}else{
			setup_cetakIPBNilaiKontrak.show();
		}
		getKontenIPB();
	});
	setup_cetakIPBNilaiKontrak.on('select',getKontenIPB);
	
	setup_pasalJenisKontrak.on('select',getKonten);
	setup_pasalContentType.on('select',
		function(){
			var type_konten = setup_pasalContentType.getValue();
			if (type_konten == 'Header'){
				setup_pasalNilaiKontrak.hide();
			}else{
				setup_pasalNilaiKontrak.show();
			}
			getKonten();
		}
	);
	setup_pasalNilaiKontrak.on('select',getKonten);
	setup_ppnField= new Ext.form.TextField({
		id: 'setup_ppnField',
		name: 'setup_ppn',
		fieldLabel: 'Nilai PPN',
		maxLength: 150,
		allowBlank: false,
		anchor: '20%'
	});
	setup_kdvoField= new Ext.form.TextField({
		id: 'setup_kdvoField',
		name: 'setup_kdvo',
		fieldLabel: 'Nama KDVO',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb5Field= new Ext.form.TextField({
		id: 'setup_kcb5Field',
		name: 'setup_kcb5',
		fieldLabel: 'Nama Kepala Cabang 5',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb6Field= new Ext.form.TextField({
		id: 'setup_kcb6Field',
		name: 'setup_kcb6',
		fieldLabel: 'Nama Kepala Cabang 6',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb7Field= new Ext.form.TextField({
		id: 'setup_kcb7Field',
		name: 'setup_kcb7',
		fieldLabel: 'Nama Kepala Cabang 7',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmarsitekField= new Ext.form.TextField({
		id: 'setup_procmarsitekField',
		name: 'setup_procmarsitek',
		fieldLabel: 'Nama PurcM Arsitek',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmmeField= new Ext.form.TextField({
		id: 'setup_procmmeField',
		name: 'setup_procmme',
		fieldLabel: 'Nama PurcM ME',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmstrukturField= new Ext.form.TextField({
		id: 'setup_procmstrukturField',
		name: 'setup_procmstruktur',
		fieldLabel: 'Nama PurcM Struktur',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kdvoJabatanField= new Ext.form.TextField({
		id: 'setup_kdvoJabatanField',
		name: 'setup_kdvojabatan',
		fieldLabel: 'Jabatan Tercetak KDVO',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb5JabatanField= new Ext.form.TextField({
		id: 'setup_kcb5JabatanField',
		name: 'setup_kcb5jabatan',
		fieldLabel: 'Jabatan Tercetak Kepala Cabang 5',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb6JabatanField= new Ext.form.TextField({
		id: 'setup_kcb6JabatanField',
		name: 'setup_kcb6jabatan',
		fieldLabel: 'Jabatan Tercetak Kepala Cabang 6',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_kcb7JabatanField= new Ext.form.TextField({
		id: 'setup_kcb7JabatanField',
		name: 'setup_kcb7jabatan',
		fieldLabel: 'Jabatan Tercetak Kepala Cabang 7',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmarsitekJabatanField= new Ext.form.TextField({
		id: 'setup_procmarsitekJabatanField',
		name: 'setup_procmarsitekjabatan',
		fieldLabel: 'Jabatan Tercetak PurcM Arsitek',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmmeJabatanField= new Ext.form.TextField({
		id: 'setup_procmmeJabatanField',
		name: 'setup_procmmejabatan',
		fieldLabel: 'Jabatan Tercetak PurcM ME',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	setup_procmstrukturJabatanField= new Ext.form.TextField({
		id: 'setup_procmstrukturJabatanField',
		name: 'setup_procmstrukturjabatan',
		fieldLabel: 'Jabatan Tercetak PurcM Struktur',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	/* 04-22-2013 -- penambahan parameter ProcM */
	
	setup_procmField= new Ext.form.TextField({
		id: 'setup_procmField',
		name: 'setup_procm',
		fieldLabel: 'Nama ProcM',
		maxLength: 150,
		allowBlank: false,
		anchor: '90%'
	});
	
	setup_procmJabatanField= new Ext.form.TextField({
		id: 'setup_procmJabatanField',
		name: 'setup_procmjabatan',
		fieldLabel: 'Jabatan Tercetak ProcM',
		maxLength: 75,
		allowBlank: false,
		anchor: '90%'
	});
	
	setup_ambangField = new Ext.form.NumberField({
		id: 'setup_ambangField',
		name: 'setup_ambang',
		fieldLabel: 'Ambang Nilai Kontrak',
		maxLength: 150,
		allowBlank: false,
		anchor: '30%'
	});
	/* Function for retrieve create Window Panel*/ 
	var tabs = new Ext.TabPanel({
		width: 1000,
		height: 500,
		bodyStyle:'padding:5px',
		activeTab: 0,
		items: [
			{
				title: 'Setup Tanda Tangan',
				layout : 'column',
				items : [
					{
						columnWidth:0.45,
						layout: 'form',
						labelWidth : 150,
						border:false,
						items: [setup_kdvoField,setup_procmField/* ,setup_kcb5Field,setup_kcb6Field,setup_kcb7Field */,setup_procmarsitekField,setup_procmmeField,setup_procmstrukturField] 
					},{
						columnWidth:0.55,
						layout: 'form',
						labelWidth : 200,
						border:false,
						items: [setup_kdvoJabatanField,setup_procmJabatanField/* ,setup_kcb5JabatanField,setup_kcb6JabatanField,setup_kcb7JabatanField */,setup_procmarsitekJabatanField,setup_procmmeJabatanField,setup_procmstrukturJabatanField] 
					}
				]
			}<?php if($_SESSION[SESSION_GROUPID] == 0){ ?>
			,
			{
				title: 'Setup PPN',
				layout: 'form',
				labelWidth : 150,
				border:false,
				items: [setup_ppnField] 
			},
			{
				title: 'Header dan Footer Pasal',
				layout: 'form',
				labelWidth : 150,
				border:false,
				items: [setup_pasalJenisKontrak,setup_pasalContentType,setup_pasalNilaiKontrak,setup_editContentField] 
			},
			{
				title: 'Nilai Ambang',
				layout: 'form',
				labelWidth : 150,
				border:false ,
				items: [setup_ambangField]  
			},
			{
				title: 'Cetak SPK',
				layout: 'form',
				labelWidth : 150,
				border:false ,
				items: [setup_cetakSPKContentType,setup_cetakSPKNilaiKontrak,setup_cetakSPKField]  
			},
			{
				title: 'Cetak IPB',
				layout: 'form',
				labelWidth : 150,
				border:false ,
				items: [setup_cetakIPBContentType,setup_cetakIPBNilaiKontrak,setup_cetakIPBField]  
			},
			{
				title: 'Cetak PO',
				layout: 'form',
				labelWidth : 150,
				border:false ,
				items: [setup_cetakPOContentType,setup_cetakPONilaiKontrak,setup_cetakPOField]  
			}
			<?php } ?>
		]
	});
	m_setup_saveForm = new Ext.FormPanel({
		labelAlign: 'left',
		autoHeight:true,
		frame : true,
		renderTo: 'elwindow_m_setup_save',
		title: 'Setup',
		url: 'index.php?c=c_m_setup&m=m_setup_list',
		reader: new Ext.data.JsonReader({
			root: 'results',
			totalProperty: 'total',
		},[
			{name: 'setup_ppn', type: 'int', mapping: 'PPN11'},
			{name: 'setup_kdvo', type: 'string', mapping: 'KDVO01'},
			{name: 'setup_kdvojabatan', type: 'string', mapping: 'KDVO02'},
			{name: 'setup_procmarsitek', type: 'string', mapping: 'PURCM_ARSITEK01'},
			{name: 'setup_procmarsitekjabatan', type: 'string', mapping: 'PURCM_ARSITEK02'},
			{name: 'setup_procmme', type: 'string', mapping: 'PURCM_ME01'},
			{name: 'setup_procmmejabatan', type: 'string', mapping: 'PURCM_ME02'},
			{name: 'setup_procmstruktur', type: 'string', mapping: 'PURCM_STRUKTUR01'},
			{name: 'setup_procmstrukturjabatan', type: 'string', mapping: 'PURCM_STRUKTUR02'},
			{name: 'setup_procm', type: 'string', mapping: 'PROCM01'},
			{name: 'setup_procmjabatan', type: 'string', mapping: 'PROCM02'},
			{name: 'setup_ambang', type: 'float', mapping: 'AMBANG11'}
		]),
		width: 1000,
		items:[
			{
				columnWidth:1,
				layout: 'form',
				labelWidth : 150,
				border:false,
				items: [tabs] 
			}
			],
		buttons: [{
				text: 'Simpan',
				handler: m_setup_save
			}
			,{
				text: 'Batal',
				handler: function(){
					reset_form();
				}
			}
		]
	});
	function reset_form(){
		m_setup_saveForm.load();
	}
	m_setup_saveForm.on('beforerender',function(){
		Ext.MessageBox.show({
			msg: 'Sedang memuat data, silakan tunggu...',
			progressText: 'Loading...',
			width:350,
			wait:true,
			icon:'icon-sync'
		});
		
	});
	m_setup_saveForm.on('render',function(){
		Ext.MessageBox.hide();
	});
	m_setup_saveForm.getForm().load();
	post2db='UPDATE';
});
	</script>
<body>
<div>
	<div class="col">
        <div id="fp_m_setup"></div>
		<div id="elwindow_m_setup_save"></div>
        <div id="elwindow_m_setup_search"></div>
    </div>
</div>
</body>
</html>